/**
 * 
 */
package com.googlecode.dynargs.model.constraints.validation;

/**
 * @author Federico De Faveri defaveri@gmail.com
 *
 */
public class Digits extends ValidationConstraint {

	protected int fraction;
	protected int integer;
	
	public Digits(String message, int fraction, int integer) {
		super(javax.validation.constraints.Digits.class, ValidationConstraintType.DIGITS, message);
		this.fraction = fraction;
		this.integer = integer;
	}

	/**
	 * @return the fraction
	 */
	public int getFraction() {
		return fraction;
	}

	/**
	 * @return the integer
	 */
	public int getInteger() {
		return integer;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("Digits [fraction=");
		builder.append(fraction);
		builder.append(", integer=");
		builder.append(integer);
		builder.append(", message=");
		builder.append(message);
		builder.append("]");
		return builder.toString();
	}
	
}
